<template>
    <div style="border:1px solid #BFBFBF;">
        <el-container>
            <template>
                <el-tabs :tab-position="tabPosition" style="width: 100%;">
                    <el-tab-pane label="我的联系提醒">
                        <template>
                            <p style="font-size: 16px;">我的联系提醒</p>
                            <div>
                                <div style="width: 1020px;margin: 5px 45px">
                                    <div>
                                        <el-button style="margin-bottom: -30px;margin-left: -15px" type="text" @click="pldelect">批量删除</el-button>
                                        <span style="margin-bottom: -30px;margin-left: 15px">|</span>
                                        <el-button style="margin-bottom: -30px;margin-left: 15px" type="text" @click="quxiaosc">取消选择</el-button>
                                        <el-button style="float:right;margin-left: 600px" size="small" type="primary" @click="lxtxann">新建联系提醒</el-button>
                                    </div>
                                    <el-dialog style="width: 1400px;margin: 0 auto;" title="新建联系提醒" :visible.sync="lxtxtankuan">
                                        <div class="shugan"></div>
                                        <span style="margin-left: 10px;font-size: 14px;">基本信息</span>
                                        <br/>
                                        <el-form :rules="rules" :model="lxtxList" ref="lxtxList" style="margin-top:10px;margin-left: 20px;" size="mini">
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="empId">
                                                        <label slot="label" style="font-size: 13px">负责人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.empId.empName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:200px" prop="relationwarnZt">
                                                        <label slot="label" style="font-size: 13px">状态:</label><br/>
                                                        <el-radio v-model="lxtxList.relationwarnZt" label="0">新增</el-radio>
                                                        <el-radio v-model="lxtxList.relationwarnZt" label="1">完成</el-radio>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px" prop="clientId">
                                                        <label slot="label" style="font-size: 13px">客户名称：</label>
                                                        <el-popover style="width: 700px; height: 450px;" placement="right" trigger="click" v-model="kehu">
                                                            <span style="font-size:20px;">关联客户模块</span>
                                                            <br/>
                                                            <el-input @keyup.enter.native="initData" v-model="kehuinput" style="width: 210px; margin-left: 230px; margin-bottom: 10px;">
                                                                <i slot="suffix" class="el-input__icon el-icon-search" @click="initData"></i>
                                                            </el-input>
                                                            <el-button type="primary" style="margin-left: 130px;" @click="xjkh">新 建</el-button>
                                                            <el-table highlight-current-row border ref="kehulist" :data="kehulist">
                                                                <el-table-column type="selection" width="50" align="center" property="clientId"></el-table-column>
                                                                <el-table-column width="150" property="clientName" label="客户名称"></el-table-column>
                                                                <el-table-column width="100" property="clientRank" label="级别"></el-table-column>
                                                                <el-table-column width="150" property="clientMobile" label="手机号码"></el-table-column>
                                                                <el-table-column width="200" property="clientSite" label="地址"></el-table-column>
                                                            </el-table>
                                                            <el-pagination @size-change="handleSizeChange" @current-change="changePage" :current-page.sync="currPages"
                                                                           :page-size="pageSizes" layout="total, prev, pager, next" :total="totalSizes" >
                                                            </el-pagination>
                                                            <div style="text-align: center;width: 100%" class="dialog-footer">
                                                                <el-button type="primary" @click="xzkehu">保 存</el-button>
                                                                <el-button type="primary" @click="kehu = false">取 消</el-button>
                                                            </div>
                                                            <el-input v-model="lxtxList.clientId.clientName"
                                                                      placeholder="+添加" slot="reference" :readonly='true' style="width: 250px;"></el-input>
                                                        </el-popover>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:250px;" prop="relationwarnTime">
                                                        <label slot="label" style="font-size: 13px">联系时间:</label>
                                                        <el-date-picker v-model="lxtxList.relationwarnTime" align="right" type="datetime"
                                                                        style="width: 250px" placeholder="选择日期"
                                                                        :picker-options="pickerOptions">
                                                        </el-date-picker>
                                                    </el-form-item>
                                                </el-col>

                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:200px" prop="relationwarnLx">
                                                        <label slot="label" style="font-size: 13px">联系类型:</label>
                                                        <el-select v-model="lxtxList.relationwarnLx" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in lxlx" :key="item.valuelx"
                                                                       :label="item.label" :value="item.valuelx">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:250px;" prop="linkmanId">
                                                        <label slot="label" style="font-size: 13px">客户联系人:</label>
                                                        <el-select v-model="lxtxList.linkmanId" value-key="linkmanId" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in khlxr" :key="item.linkmanId"
                                                                       :label="item.linkmanName" :value="item">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="24">
                                                    <el-form-item style="width:250px;" prop="relationwarnNr">
                                                        <label style="font-size: 13px">内容:</label>
                                                        <textarea placeholder="请填写本次联系计划目标内容"
                                                                  v-model="lxtxList.relationwarnNr" style="width: 595px; height: 70px;"></textarea>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                        </el-form>
                                        <div slot="footer" style="text-align: center" class="dialog-footer">
                                            <el-button @click="qxff">取 消</el-button>
                                            <el-button type="primary" @click="yesok('lxtxList')">确 定</el-button>
                                        </div>
                                    </el-dialog>

                                    <el-dialog style="width: 1400px;margin: 0 auto;" title="编辑联系提醒" :visible.sync="xglxtxtankuan">
                                        <div class="shugan"></div>
                                        <span style="margin-left: 10px;font-size: 14px;">基本信息</span>
                                        <br/>
                                        <el-form :rules="ruless" ref="lxtxList" :model="lxtxList" style="margin-top:10px;margin-left: 20px;" size="mini">
                                            <el-row>
                                                <el-form-item style="display:none" prop="clientId"><!--客户id-->
                                                    <el-input v-model="clientlist.clientId" style="display:none"></el-input>
                                                </el-form-item>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="clientName">
                                                        <label slot="label" style="font-size: 13px">客户名称:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.clientId.clientName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:250px;" prop="empId">
                                                        <label slot="label" style="font-size: 13px">负责人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.empId.empName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="relationwarnTime">
                                                        <label slot="label" style="font-size: 13px">联系时间:</label>
                                                        <el-date-picker v-model="lxtxList.relationwarnTime" align="right" type="datetime"
                                                                        style="width: 250px" placeholder="选择日期"
                                                                        :picker-options="pickerOptions">
                                                        </el-date-picker>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:200px" prop="relationwarnLxs">
                                                        <label slot="label" style="font-size: 13px">联系类型:</label>
                                                        <el-select v-model="lxtxList.relationwarnLx" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in lxlx" :key="item.valuelx"
                                                                       :label="item.label" :value="item.valuelx">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="linkmanIds">
                                                        <label slot="label" style="font-size: 13px">客户联系人:</label>
                                                        <el-select v-model="lxtxList.linkmanId" value-key="linkmanId" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in khlxr" :key="item.linkmanId"
                                                                       :label="item.linkmanName" :value="item">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="24">
                                                    <el-form-item style="width:250px;" prop="relationwarnNr">
                                                        <label style="font-size: 13px">内容:</label>
                                                        <textarea placeholder="请填写本次联系计划目标内容"
                                                                  v-model="lxtxList.relationwarnNr" style="width: 595px; height: 70px;"></textarea>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                        </el-form>
                                        <div slot="footer" style="text-align: center" class="dialog-footer">
                                            <el-button @click="xglxtxtankuan = false">取 消</el-button>
                                            <el-button type="success" @click="bjlxtxzt1" v-if="lxtxList.relationwarnZt==0">完 成 提 醒</el-button>
                                            <el-button type="success" @click="bjwlxtxzt2" v-if="lxtxList.relationwarnZt==1">标 记 未 完 成</el-button>
                                            <el-button type="primary" @click="yesoks('lxtxList')">保 存</el-button>
                                        </div>
                                    </el-dialog>
                                </div>

                                <el-collapse v-model="activeNames" style="width:1050px; margin-left: 30px; margin-top:30px;" @change="handleChange">
                                    <el-checkbox-group v-model="checkList">
                                    <el-collapse-item v-if="this.lxtxLists[0]!=null" class="lx" title="今日需联系的 >" name="1">
                                        <div class="divs" v-for="(item, i) in lxtxLists" :key="item.relationwarnId">
                                            <el-col :span="13">
                                                <el-checkbox class="cbx" :label="item" :key="item.relationwarnId" style="margin-left: 15px;"><span style="display: none">{{item.relationwarnId}}</span></el-checkbox>
                                                <span style="margin-left: 5px;" @click="lxtxann2(item)">
                                                    {{i+1}}、 联系【{{item.linkmanId.linkmanName}}】</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{item.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{item.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button type="text" @click="bjlxtxzt(item)" v-if="item.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(item)" v-if="item.relationwarnZt==1">标记未完成</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(item)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>

                                    <el-collapse-item v-if="this.lxtxListser[0]!=null" class="mrlx" title="明日需联系的 >" name="2">
                                        <div class="divsmr" v-for="(items,i) in lxtxListser" :key="items.relationwarnId">
                                            <el-col :span="13">
                                                <el-checkbox :label="items" :key="items.relationwarnId" style="margin-left: 15px;"><span style="display: none">{{items.relationwarnId}}</span></el-checkbox>
                                                <span style="margin-left: 5px;" @click="lxtxann2(items)">{{i+1}}、 联系【{{items.linkmanId.linkmanName}}】</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{items.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{items.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button type="text" @click="bjlxtxzt(items)" v-if="items.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(items)" v-if="items.relationwarnZt==1">标记未完成</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(items)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>

                                    <el-collapse-item v-if="this.lxtxListssan[0]!=null" class="lx2" title="即将需联系的 >" name="3">
                                        <div class="divsjj" v-for="(itemss,i) in lxtxListssan" :key="itemss.relationwarnId">
                                            <el-col :span="13">
                                                <el-checkbox :label="itemss" :key="itemss.relationwarnId" style="margin-left: 15px;"><span style="display: none">{{itemss.relationwarnId}}</span></el-checkbox>
                                                <span style="margin-left: 5px;" @click="lxtxann2(itemss)">{{i+1}}、 联系【{{itemss.linkmanId.linkmanName}}】</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{itemss.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{itemss.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button style="padding-top: -25px;" type="text" @click="bjlxtxzt(itemss)" v-if="itemss.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(itemss)" v-if="itemss.relationwarnZt==1">标记未完成</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(itemss)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>

                                    <el-collapse-item v-if="this.lxtxListssi[0]!=null" class="lx3" title="已经延期 >" name="5">
                                        <div class="divs2" v-for="(itemss,i) in lxtxListssi" :key="itemss.relationwarnId">
                                            <el-col :span="13">
                                                <el-checkbox :label="itemss" :key="itemss.relationwarnId" style="margin-left: 15px;"><span style="display: none">{{itemss.relationwarnId}}</span></el-checkbox>
                                                <span style="margin-left: 5px;" @click="lxtxann2(itemss)">{{i+1}}、 联系【{{itemss.linkmanId.linkmanName}}】</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{itemss.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{itemss.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button style="padding-top: -25px;" type="text" @click="bjlxtxzt(itemss)" v-if="itemss.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(itemss)" v-if="itemss.relationwarnZt==1">标记未完成</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(itemss)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>
                                    </el-checkbox-group>
                                </el-collapse>
                            </div>
                        </template>
                    </el-tab-pane>

                    <el-tab-pane label="分配给我的线索" style="height: 620px;">
                        <template>
                            <p style="font-size: 16px;">分配给我的线索</p>
                        </template>
                        <template>
                            <el-select v-model="xsgj" placeholder="待跟进" @change="changebusni2">
                                <el-option v-for="item in options3" :key="item.value3"
                                           :label="item.label" :value="item.value3">
                                </el-option>
                            </el-select>
                            <div style="height: 30px;">
                                <div v-show="cje" style=" width: 100%; height: 40px;background-color: white;">
                                    <div style="display:inline; position: relative; top: 10px;">
                                        <span style="color: gray; font-size: 14px; margin-left: 10px;">已选中<span style="color: gray; font-size: 14px;">{{count}}</span>项</span>
                                    </div>
                                    <div style="display:inline; position: relative; top: 10px;">
                                        <span style="margin-left: 25px;">|</span>
                                    </div>
                                    <div style="display:inline; position: relative; top: 10px;">
                                        <i class="el-icon-data-line" style="margin-left: 25px;"></i>
                                        <el-link :underline="false" style=" font-size: 14px;" @click="xggjzt">已跟进</el-link>
                                    </div>
                                </div>
                            </div>
                        </template>
                        <el-table max-height="450" ref="multipleTable" :data="clueList" tooltip-effect="dark"
                                  style="width: 100%; height: 450px;" @selection-change="handleSelectionChange">
                            <el-table-column type="selection" width="55" align="center">
                            </el-table-column>
                            <el-table-column fixed prop="clueId" label="ID" sortable align="center" width="60">
                            </el-table-column>
                            <el-table-column prop="clueName" label="线索名称" width="130">
                                <template slot-scope="sp">
                                    <a v-html="sp.row.clueName" class="businame" @click="xstodetails(sp.row)"></a>
                                </template>
                            </el-table-column>
                            <el-table-column prop="clientId.clientIndustry" label="客户行业" width="110">
                            </el-table-column>
                            <el-table-column sortable prop="clueEstablishtime" label="下次联系时间" width="170">
                                <template slot-scope="p">
                                    {{p.row.clueEstablishtime | formatDate}}
                                </template>
                            </el-table-column>
                            <el-table-column prop="cluePeople" label="负责人">
                            </el-table-column>
                            <el-table-column prop="clueSite" label="地址" width="280">
                            </el-table-column>
                            <el-table-column prop="cluePerson" label="创建人" width="100">
                            </el-table-column>
                            <el-table-column sortable prop="clueNowtime" label="创建时间" width="180">
                                <template slot-scope="p">
                                    {{p.row.clueNowtime | formatDate}}
                                </template>
                            </el-table-column>
                            <el-table-column prop="clueRemark" label="备注" width="150">
                            </el-table-column>
                        </el-table>
                        <div style="margin-left: 300px;margin-top: 20px;">
                            <el-pagination @size-change="handleSizeChange2" @current-change="changePage2"
                                           :current-page.sync="currPage2" :page-sizes="sizes2"
                                           :page-size="pageSize2" layout="total, sizes, prev, pager, next, jumper"
                                           :total="totalSize2" >
                            </el-pagination>
                        </div>
                    </el-tab-pane>

                    <el-tab-pane label="分配给我的客户" style="height: 620px;">
                        <template>
                            <p style="font-size: 16px;">分配给我的客户</p>
                            <template>
                                <el-select v-model="gj" placeholder="待跟进" @change="changebusni">
                                    <el-option v-for="item in options4" :key="item.value4"
                                               :label="item.label" :value="item.value4">
                                    </el-option>
                                </el-select>
                                <div style="height: 30px;">
                                    <div v-show="cje2" style=" width: 100%; height: 40px;background-color: white;">
                                        <div style="display:inline; position: relative; top: 10px;">
                                            <span style="color: gray; font-size: 14px; margin-left: 10px;">已选中<span style="color: gray; font-size: 14px;">{{count2}}</span>项</span>
                                        </div>
                                        <div style="display:inline; position: relative; top: 10px;">
                                            <span style="margin-left: 25px;">|</span>
                                        </div>
                                        <div style="display:inline; position: relative; top: 10px;">
                                            <i class="el-icon-data-line" style="margin-left: 25px;"></i>
                                            <el-link :underline="false" style=" font-size: 14px;" @click="xgkclientgj">已跟进</el-link>
                                        </div>
                                    </div>
                                </div>
                            </template>
                            <el-table @selection-change="handleSelectionChange2" max-height="450"
                                      ref="multipleTable2" :data="meclientList" tooltip-effect="dark"
                                      style="width: 100%; height:450px;">
                                <el-table-column type="selection" width="55" align="center">
                                </el-table-column>
                                <el-table-column fixed prop="clientId" label="ID" sortable align="center" width="60">
                            </el-table-column>
                                <el-table-column prop="clientName" label="客户名称" width="120">
                                    <template slot-scope="sp">
                                        <a v-html="sp.row.clientName" class="businame" @click="todetails(sp.row)"></a>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="clientCjpeople" label="创建人" width="100">
                                </el-table-column>
                                <el-table-column prop="clientMobile" label="手机" width="120">
                                </el-table-column>
                                <el-table-column prop="clientPhone" label="电话" width="100">
                                </el-table-column>
                                <el-table-column prop="clientIndustry" label="客户行业" width="160">
                                </el-table-column>
                                <el-table-column sortable prop="establishPerson" label="下次联系时间" width="170">
                                    <template slot-scope="p">
                                        {{p.row.establishPerson | formatDate}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="clientUrl" label="网址" width="150">
                                </el-table-column>
                                <el-table-column prop="clientPeople" label="负责人" width="100">
                                </el-table-column>
                                <el-table-column sortable prop="establishTime" label="创建时间" width="170">
                                    <template slot-scope="p">
                                        {{p.row.establishTime | formatDate}}
                                    </template>
                                </el-table-column>
                                <el-table-column prop="clientRank" label="客户级别" width="120">
                                </el-table-column>
                                <el-table-column prop="clientSource" label="客户来源" width="120">
                                </el-table-column>
                                <el-table-column sortable prop="updateTime" label="更新时间" width="170">
                                    <template slot-scope="p">
                                        {{p.row.updateTime | formatDate}}
                                    </template>
                                </el-table-column>
                            </el-table>
                            <div style="margin-left: 300px;margin-top: 20px;">
                                <el-pagination @size-change="handleSizeChange3" @current-change="changePage3" :current-page.sync="currPage3" :page-sizes="sizes3"
                                               :page-size="pageSize3" layout="total, sizes, prev, pager, next, jumper" :total="totalSize3" >
                                </el-pagination>
                            </div>
                        </template>
                    </el-tab-pane>
                </el-tabs>
            </template>
        </el-container>
    </div>
</template>

<script>
    import {formatTimeToStr} from '../router//format.js';
    import Crypto  from '../router//secret.js'
    export default {
        name: "TfyClientHomepage",
        data(){
            var client = (rule, value, callback) => {
                if (value.clientName === null || value.clientName === '') {
                    callback(new Error('请选择客户'));
                }else {
                    callback()
                }
            };
            return {
                rules: {
                    clientId:[{ validator: client, required: true, trigger: ['blur','change']},],
                    relationwarnTime:[{ required: true, message: '请选择联系时间' , trigger: 'change'},],
                    relationwarnLx:[{ required: true, message: '请选择联系类型' , trigger: 'change'},],
                    linkmanId:[{ required: true, message: '请选择客户联系人' , trigger: 'blur'},],
                },
                ruless: {
                    relationwarnTime: [{ required: true, message: '请选择联系时间' , trigger: 'change'},],
                },
                checkList:[],
                isIndeterminate: false,
                //联系类型
                lxlx: [{
                    valuelx: '打电话',
                    label: '打电话'
                }, {
                    valuelx: '发邮件',
                    label: '发邮件'
                }, {
                    valuelx: '发短信',
                    label: '发短信'
                }, {
                    valuelx: '见面拜访',
                    label: '见面拜访'
                }, {
                    valuelx: '汇报记录',
                    label: '汇报记录'
                }, {
                    valuelx: '会晤',
                    label: '会晤'
                }, {
                    valuelx: '活动',
                    label: '活动'
                }, {
                    valuelx: '商务宴会',
                    label: '商务宴会'
                }, {
                    valuelx: '其他',
                    label: '其他'
                }],
                valuelx: '',
                linkmanList:{//表单
                    linkmanId:0,
                    clientId:{
                        clientId:0,
                        updateTime:'',
                        clientIndustry:'',
                        clientSource:'',
                        clientUrl:'',
                        establishPerson:'',
                        establishTime:'',
                        clientName:'',
                        clientRank:'',
                        clientPhone:'',
                        clientMobile:'',
                        clientSite:'',
                        clientRemark:'',
                        clientPeople:'',
                        clientCjpeople:'',
                        clientState:0,
                    },
                    empId:{
                        empId:0,
                        empName:'',
                        depId:{//部门
                            depId:0,
                            depName:'',
                        },
                    },
                    linkmanName:'',//联系人名称
                    linkmanPhone:'',//联系人电话号码
                    linkmanMobile:'',//联系人手机号码
                    emailAddress:'',//联系人电子邮箱
                    keyPolicymaker:'',//联系人是否关键决策人
                    linkmanPosition:'',//联系人职位
                    linkmanSex:'',//联系人性别
                    linkmanSite:'',//联系人地址
                    linkmanTime:'',//联系人下次联系时间
                    linkmanRemark:'',//联系人备注
                    linkmanBirthday:'',//联系人出生日期
                    linkmanSz:'',
                },
                kehu:false,//客户弹出框
                kehuinput:'',//客户弹框搜索框
                kehulist:[],//客户表格信息
                pageSizes:5,//客户分页页大小
                currPages:1,//客户当前页码，默认为1
                totalSizes:0,//客户总记录数
                datavalue:'',//日期
                radio: '0',//单选框x
                lxtxtankuan:false,//弹框
                xglxtxtankuan:false,//修改弹框
                activeNames: ['1','2','3','4','5'],//联系提醒
                clientList: [],
                clueList: [],
                meclientList: [],
                multipleTable: [],//存放选中值的数组
                multipleTable2: [],//存放选中值的数组
                //页数
                pageSize:5,//分页页大小
                currPage:1,//当前页码，默认为1
                totalSize:0,//总记录数
                sizes:[5, 10, 15, 20],
                //分页2
                pageSize2:5,//分页页大小
                currPage2:1,//当前页码，默认为1
                totalSize2:0,//总记录数
                sizes2:[5, 10, 15, 20],
                //分页3
                pageSize3:5,//分页页大小
                currPage3:1,//当前页码，默认为1
                totalSize3:0,//总记录数
                sizes3:[5, 10, 15, 20],
                tabPosition: 'left',

                options2: [{
                    values: '选项1',
                    label: '我的'
                }, {
                    values: '选项2',
                    label: '我属下的'
                }],
                values: '',

                options3: [{
                    value3: '待跟进',
                    label: '待跟进'
                }, {
                    value3: '已跟进',
                    label: '已跟进'
                }],
                value3: '',

                options4: [{
                    value4: '待跟进',
                    label: '待跟进'
                }, {
                    value4: '已跟进',
                    label: '已跟进'
                }],
                value4: '',
                gj:[],
                xsgj:[],
                cje:false,//跟进
                cje2:false,//跟进2
                //快捷日期选择器
                pickerOptions: {
                    disabledDate(time) {
                        return time.getTime() < Date.now();
                    },
                    shortcuts: [{
                        text: '今天',
                        onClick(picker) {
                            picker.$emit('pick', new Date());
                        }
                    }]
                },
                clientlist: {//客户表单
                    clientId:0,
                    clientName:'',//公司名称
                    clientIndustry:'',//公司行业
                    clientSource:'',//客户来源
                    clientPhone:'',//客户电话
                    clientMobile:'',//客户手机
                    clientUrl:'',//客户网址
                    clientRank:'',//客户级别
                    clientSite:'',//客户地址
                    establishPerson:'',//下次联系时间
                    clientRemark:'',//客户备注
                    linkmanId:{//联系人
                        linkmanId:0,
                        linkmanName:'',
                        linkmanMobile:'',
                        linkmanPosition:'',
                        linkmanPeople:'',
                    },
                    empId:{
                        empId:0,
                        empName:''
                    },
                    operationId:{//操作表
                        operationId:0,
                        operationContent:'',
                        operationTime:'',
                    },
                    relationwarnId:{//联系提醒表
                        relationwarnId:0,
                        relationwarnNr:'',
                        relationwarnLx:'',
                        relationwarnTime:'',
                        relationwarnZt:'0',
                        relationwarnJd:0,
                    }
                },
                lxtxList:{//联系提醒表
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxLists:{//今日需联系提醒表
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxListser:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxListssan:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxListssi:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                empid:0,
                xg:'',
                khlxr:[],//客户联系人
                emplist:{
                    empId:0,
                    empName:'',
                },
            };
        },
        methods:{
            yesok(formName) {
                if(this.xg != 0){
                    this.addlxtx();
                }else {
                    this.$refs[formName].validate(valid => {
                        this.print(valid);
                        window.console.log("111:"+valid)
                        if (valid) {
                            this.addlxtx();
                        } else {
                            this.$message({
                                message: '验证不通过！',
                                type: 'warning'
                            });
                            return false;
                        }
                    });
                }
            },
            yesoks(formName) {
                if(this.xg != 0){
                    this.bjlxtx();
                }else {
                    this.$refs[formName].validate(valid => {
                        this.print(valid);
                        window.console.log("111:"+valid)
                        if (valid) {
                            this.bjlxtx();
                        } else {
                            this.$message({
                                message: '验证不通过！',
                                type: 'warning'
                            });
                            return false;
                        }
                    });
                }
            },
            pldelect(){//批量删除
                if(this.checkList.length<1){
                    this.$message({
                        showClose: true,
                        message: '请选择勾选要删除的提醒',
                        type: 'error'
                    });
                }else{
                    this.checkList.forEach(a=>{
                        window.console.log("联系提醒："+a.relationwarnId)
                    })
                    var list = JSON.stringify({khdxlist:this.checkList});
                    this.print("khlist:"+list);
                    this.$confirm('此操作将删除该提醒, 是否继续?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(() => {
                        this.$axios.post("http://localhost:8088/delrelationwarn-list",this.qs.stringify({
                            khdx:list
                        })).then(() => {
                            this.print("数据："+this.checkList);
                            this.ygid();
                            this.checkList = [];
                            this.$message({
                                showClose: true,
                                type: 'success',
                                message: '删除成功!',
                            });
                        }).catch(v=> {
                            alert("加载失败删除："+v.data);
                        })
                    }).catch(() => {
                        this.checkList = [];//取消选中
                        this.$message({
                            type: 'info',
                            message: '已取消删除'
                        });
                    });
                }
            },
            quxiaosc(){//取消批量删除
                if(this.checkList.length >= 1){
                    this.checkList = [];
                }
            },
            lxtxann(){//联系提醒按钮
                this.initDatayg();
                this.lxtxList.empId = this.empid;
                this.lxtxList.relationwarnTime = null;
                this.lxtxList.relationwarnLx = null;
                this.lxtxList.relationwarnNr = null;
                this.lxtxList.clientId.clientName = null;
                this.lxtxList.linkmanId = [];
                this.lxtxtankuan = true;
            },
            lxtxann2(row){
                window.console.log(row)
                this.lxtxList= row;
                this.khlxrs();
                this.xglxtxtankuan = true;
            },
            handleChange(val) {//联系提醒
                console.log(val);
            },
            clientcx(){//客户id查询
                var id = this.lxtxList.clientId.clientId;
                this.$axios.post("http://localhost:8088/clientid-list",this.qs.stringify(
                    {clientId:parseInt(id)})).then(v=>{
                    this.clientlist = v.data;
                    //表信息
                    this.khlxrs(parseInt(id));//客户联系人查询
                }).catch();
            },
            //客户id查询联系人方法
            khlxrs(){
                var id = this.lxtxList.clientId.clientId;
                this.$axios.post("http://localhost:8088/cxlinkman-list",this.qs.stringify(
                    {id: id})).then(v=>{
                    this.khlxr = v.data;
                }).catch();
            },
            //选择客户确定按钮
            xzkehu() {
                this.$refs.kehulist.selection.forEach((pro)=>{
                    this.lxtxList.clientId=pro;
                    window.console.log("查询："+this.lxtxList.clientId.clientId)
                    this.khlxrs();
                });
                this.kehu=false;
                this.kehuinput='';
            },
            //根据员工id查询客户方法
            initData(){
                this.$axios.post("http://localhost:8088/ygclient-list",this.qs.stringify(
                    {search:this.kehuinput, empId:this.empid, page:this.currPages, size:this.pageSizes}))
                    .then(v=>{
                        this.kehulist = v.data.rows;
                        this.totalSizes = v.data.total;
                        this.khlxrs();
                        window.console.log("ss"+v.data.rows)
                    })
                    .catch()
            },
            changePage(v){
                this.currPages = v;
                this.initData();
            },
            addlxtx(){//新增联系提醒
                window.console.log("对象:"+this.lxtxList.linkmanId)
                if (this.xg == 0) {
                    this.$axios.post("http://localhost:8088/addlxtx-list", this.lxtxList)
                        .then(() => {
                            this.ygid();
                            this.$message({
                                showClose: true,
                                type: 'success',
                                message: '新增成功!',
                            });
                            this.lxtxtankuan = false;
                        }).catch(() => {
                        this.$message({
                            showClose: true,
                            message: '新增失败',
                            type: 'error'
                        });
                    })
                }
            },
            qxff(){//联系提醒取消弹框
                this.lxtxtankuan = false;
            },
            bjlxtxzt1(){//修改联系提醒的完成状态
                this.$axios.post("http://localhost:8088/xgztlxtx-list", this.lxtxList)
                    .then(() => {
                        this.ygid();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjwlxtxzt2(){//修改联系提醒的未完成状态
                this.$axios.post("http://localhost:8088/xgztwlxtx-list", this.lxtxList)
                    .then(() => {
                        this.ygid();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为未完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjlxtxzt(row){//修改联系提醒的完成状态
                this.lxtxList = row;
                this.$axios.post("http://localhost:8088/xgztlxtx-list", this.lxtxList)
                    .then(() => {
                        this.ygid();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjwlxtxzt(row){//修改联系提醒的未完成状态
                this.lxtxList = row;
                this.$axios.post("http://localhost:8088/xgztwlxtx-list", this.lxtxList)
                    .then(() => {
                        this.ygid();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为未完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjlxtx(){//修改联系提醒
                this.$axios.post("http://localhost:8088/addlxtx-list", this.lxtxList)
                    .then(() => {
                        this.ygid();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '修改成功!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '修改失败',
                        type: 'error'
                    });
                })
            },
            sclxtx(row){//删除联系提醒
                this.lxtxList = row;
                this.$confirm('确认删除该提醒?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$axios.post("http://localhost:8088/sclxtx-list", this.lxtxList)
                        .then(() => {
                            this.ygid();
                            this.$message({
                                showClose: true,
                                type: 'success',
                                message: '删除成功!',
                            });
                        }).catch(() => {
                        this.$message({
                            showClose: true,
                            message: '删除失败',
                            type: 'error'
                        });
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            ygid(){//根据员工id查询联系提醒
                this.$axios.post("http://localhost:8088/business/getbuspeopleid").then(v=>{
                    window.console.log("id:"+v.data)
                    this.empid = v.data;
                    this.cxlxtx(this.empid);
                    this.cxlxtxm(this.empid);
                    this.cxlxtxjj(this.empid);
                    this.cxlxtxyyq(this.empid);
                    this.initData(this.kehuinput,this.empid);
                    this.initDatayg(this.empid);
                }).catch();
            },
            //员工id查询方法
            initDatayg(){
                this.$axios.post("http://localhost:8088/cxidemp-list",this.qs.stringify(
                    {empId:this.empid}))
                    .then(v=>{
                        this.lxtxList.empId = v.data;
                    })
                    .catch()
            },
            cxlxtx(){//根据员工id查询今日联系提醒
                this.$axios.post("http://localhost:8088/jridlxtx-list",this.qs.stringify(
                    {empId: this.empid})).then(v=>{
                    this.lxtxLists = v.data;
                }).catch();
            },
            cxlxtxm(){//根据员工id查询明日联系提醒
                this.$axios.post("http://localhost:8088/mridlxtx-list",this.qs.stringify(
                    {empId: this.empid})).then(v=>{
                    this.lxtxListser = v.data;
                }).catch();
            },
            cxlxtxjj(){//根据员工id查询即将联系提醒
                this.$axios.post("http://localhost:8088/jjidlxtx-list",this.qs.stringify(
                    {empId: this.empid})).then(v=>{
                    this.lxtxListssan = v.data;
                }).catch();
            },
            cxlxtxyyq(){//根据员工id查询已延期联系提醒
                this.$axios.post("http://localhost:8088/yyqidlxtx-list",this.qs.stringify(
                    {empId: this.empid})).then(v=>{
                    this.lxtxListssi = v.data;
                }).catch();
            },
            cxlxtx2(id){//根据客户id查询已完成联系提醒
                this.$axios.post("http://localhost:8088/wcidlxtx-list",this.qs.stringify(
                    {clientId:parseInt(id)})).then(v=>{
                    this.lxtxListser = v.data;
                }).catch();
            },
            cxlxtx3(id){//根据客户id查询已延期联系提醒
                this.$axios.post("http://localhost:8088/yqidlxtx-list",this.qs.stringify(
                    {clientId:parseInt(id)})).then(v=>{
                    this.lxtxListssan = v.data;
                }).catch();
            },
            initData1(){
                this.$axios.post("http://localhost:8088/clientdate-list",this.qs.stringify(
                    {page:this.currPage, size:this.pageSize}))
                    .then(v=>{
                        this.clientList = v.data.rows;
                        this.totalSize = v.data.total;
                    })
                    .catch();

                this.$axios.post("http://localhost:8088/clueclient-list",this.qs.stringify(
                    {page:this.currPage2, size:this.pageSize2, search:this.xsgj}))
                    .then(v=>{
                        this.clueList = v.data.rows;
                        this.totalSize2 = v.data.total;
                    })
                    .catch();

                this.$axios.post("http://localhost:8088/meclient-list",this.qs.stringify(
                    {page:this.currPage3, size:this.pageSize3, search:this.gj}))
                    .then(v=>{
                        this.meclientList = v.data.rows;
                        this.totalSize3 = v.data.total;
                    })
                    .catch();
            },
            initData2(){
                window.console.log(this.xsgj);
                this.$axios.post("http://localhost:8088/clueclient-list",this.qs.stringify(
                    {page:this.currPage2, size:this.pageSize2, search:this.xsgj}))
                    .then(v=>{
                        this.clueList = v.data.rows;
                        this.totalSize2 = v.data.total;
                    })
                    .catch();
            },
            changePage2(v){
                this.currPage2 = v;
                this.initData2();
            },
            initData3(){
                this.$axios.post("http://localhost:8088/meclient-list",this.qs.stringify(
                    {page:this.currPage3, size:this.pageSize3, search:this.gj}))
                    .then(v=>{
                        this.meclientList = v.data.rows;
                        this.totalSize3 = v.data.total;
                    })
                    .catch();
            },
            changePage3(v){
                this.currPage3 = v;
                this.initData3();
            },
            changebusni(){
                this.initData3(this.currPage3, this.pageSize3,this.gj);
            },
            changebusni2(){
                this.initData2(this.currPage2, this.pageSize2,this.xsgj);
            },
            xjkh(){
                this.$router.replace('/xjkh')
            },
            xggjzt() {//线索跟进修改
                var list = JSON.stringify({cluelist:this.multipleTable});
                this.print("cluelist:"+list);
                this.$confirm('您确定此操作吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$axios.post("http://localhost:8088/gjclue-list",this.qs.stringify({
                        cluedx:list
                    })).then(() => {
                        this.print("数据："+this.multipleTable);
                        this.clueList.forEach((xs)=>{
                            this.print(xs);
                            this.initData2();
                        });
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '操作成功!',
                        });
                    }).catch(v=> {
                        alert("加载失败操作："+v.data);
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消操作'
                    });
                });
            },
            xgkclientgj(){//客户跟进修改
                var list = JSON.stringify({khdxlist:this.multipleTable2});
                this.print("khlist:"+list);
                this.$confirm('您确定此操作吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$axios.post("http://localhost:8088/gjclient-list",this.qs.stringify({
                        khdx:list
                    })).then(() => {
                        this.print("数据："+this.multipleTable2);
                        this.meclientList.forEach((kh)=>{
                            this.print(kh);
                            this.initData3();
                        });
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '操作成功!',
                        });
                    }).catch(v=> {
                        alert("加载失败操作："+v.data);
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消操作'
                    });
                });
            },
            /*跳转详情方法*/
            todetails(rows){
                rows = escape(Crypto.set(rows.clientId)); // 加密数据
                this.$router.push({
                    path:'/tfyxq',
                    query: {
                        row:rows
                    }
                })
            },
            /*线索跳转详情方法*/
            xstodetails(rows){
                rows = escape(Crypto.set(rows.clueId)); // 加密数据
                this.$router.push({
                    path:'/tfyxsxq',
                    query: {
                        row:rows
                    }
                })
            },
            //复选框选中的
            handleSelectionChange(val) {
                this.multipleTable = val;//  this.multipleTable 选中的值
                if(this.multipleTable.length>0){
                    this.cjy=false;//第一行隐藏
                    this.cje=true;//批量操作栏出现
                }
                //选中项大于1不能执行添加跟进记录和修改按钮
                if(this.multipleTable.length>1){
                    this.isOne=false;
                }else if(this.multipleTable.length==0){//选中项为0时
                    this.cjy=true;//第一行出现
                    this.cje=false;//批量操作栏隐藏
                }else{
                    this.isOne=true;//添加跟进记录和修改出现
                }
                window.console.log(val);
            },
            //复选框选中的
            handleSelectionChange2(val) {
                this.multipleTable2 = val;//  this.multipleTable 选中的值
                if(this.multipleTable2.length>0){
                    this.cjy2=false;//第一行隐藏
                    this.cje2=true;//批量操作栏出现
                }
                //选中项大于1不能执行添加跟进记录和修改按钮
                if(this.multipleTable2.length>1){
                    this.isOne=false;
                }else if(this.multipleTable2.length==0){//选中项为0时
                    this.cjy2=true;//第一行出现
                    this.cje2=false;//批量操作栏隐藏
                }else{
                    this.isOne=true;//添加跟进记录和修改出现
                }
                window.console.log(val);
            },
            handleSizeChange(val){
                window.console.log('每页${val}条')
                this.initData(1,this.pageSizes=val,this.kehulist,this.kehuinput,this.empid)
            },
            handleSizeChange2(val){
                window.console.log('每页${val}条')
                this.initData2(1,this.pageSize2=val,this.clueList,this.xsgj)
            },
            handleSizeChange3(val){
                window.console.log('每页${val}条')
                this.initData3(1,this.pageSize3=val,this.meclientList,this.gj)
            }
        },
        computed:{
            count(){
                return this.multipleTable.length
            },
            count2(){
                return this.multipleTable2.length
            }
        },
        created: function () {
            this.pageSize2 = this.sizes2[0];
            this.pageSize3 = this.sizes3[0];
            this.initData2(this.currPage2, this.pageSize2,this.xsgj);
            this.initData3(this.currPage3, this.pageSize3,this.gj);
            this.initData(this.currPages, this.pageSizes,this.kehuinput,this.empid);
            this.ygid();
        },
        filters:{
            formatDate: function(time) {
                if(time != null && time != ""){
                    var date = new Date(time);
                    return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
                }else{
                    return "";
                }
            }
        }
    }
</script>

<style scoped>
    .shugan{
        border-left-color: rgb(70, 205, 207);
        border-left-width: 4.8px;
        height: 10px;
        border-left-style: solid;
        display: inline;
        font-size: 13px;
    }
    .lx div:hover{
        background-color: aliceblue;
        cursor:pointer;
    }
    .mrlx div:hover{
         background-color: #FFE5A9;
         cursor:pointer;
     }
    .lx2 div:hover{
        background-color: #CEEFC8;
        cursor:pointer;
    }
    .lx3 div:hover{
        background-color: #e6e6e6;
        cursor:pointer;
    }
    .divs{
        border:1px solid darkturquoise;
        border-radius: 4px;
        height:40px;
        width: 1040px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .divsjj{
         border:1px solid #90D56E;
        border-radius: 4px;
         height:40px;
         width: 1040px;
         font-size: 16px;
         padding-top: 10px;
         margin-bottom: 5px;
     }
    .divsmr{
         border:1px solid #FDB800;
         border-radius: 4px;
         height:40px;
         width: 1040px;
         font-size: 16px;
         padding-top: 10px;
         margin-bottom: 5px;
     }
    .divs1{
        border:1px solid #6BD089;
        border-radius: 4px;
        height:40px;
        width: 1040px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .divs2{
        border:1px solid #A0A0A0;
        border-radius: 4px;
        height:40px;
        width: 1040px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .ysclass{
        color: gray;
    }
    .el-tabs{
        background-color: white;
    }
    .el-header, .el-footer {
        background-color: #B3C0D1;
        color: #333;
    }

    body > .el-container {
        margin-bottom: 40px;
    }

    .el-container:nth-child(5) .el-aside,
    .el-container:nth-child(6) .el-aside {
        line-height: 260px;
    }

    .el-container:nth-child(7) .el-aside {
        line-height: 320px;
    }
    .businame{
        color: #409EFF;
        cursor:pointer;
    }
</style>